<?php
namespace App\Http\Questionnaire\Controllers;

use Illuminate\Http\Request;
use App\Http\Admin\Controllers\Controller as Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use mysql_xdevapi\Exception;
use App\Http\Questionnaire\Controllers\WordController;

class ProblemQController  extends Controller
{
    public function __construct(Request $request)
    {
        $token = getToken($request);
        $uid = Redis::get("code:" . $token);
        $this->uid = $uid;
    }

    public function created(){
//
    }
    /*
      *  添加选项
      *  @author 小林《1814992057@qq.com》
      *  @datetime   2019/11/20
      *  @request    post
      *  @Param      questionnaireId    Int  问卷id
      *  @Param      problemId          Int  问题id
      *  @Param      orderId            Int  排序ID
      *  @Param      type               Int  关系类型
      *  @Param      class              Json class属性
      *  @Param      title              String 标题
      *  @Param      where              Json 子条件
      *  @Param      important          Int  是否必选 1必选 2非必选
      *  @Param      polymerization          Int  是否聚合页显示
      *  @Param      polymerization          Int  聚合页内容 1包含子关联 0不包含
      *  @return     array
      * */
    public function add(Request $request){

        $data=$request->only('questionnaireId','problemId','fqaspId','type','class','title','where','orderId','important',"img","description","PofP","polymerization","polymerizationType");


        //type不存在 格式为非字数字 长度不等于1
        if(!array_key_exists('type',$data)||!preg_match('/^[\d]{1}$/u',$data['type'])) return ThrowApiExc('32002');

        //orderId不存在 格式为非字数字 长度不等于1
//        if(!array_key_exists('orderId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['orderId'])) return ThrowApiExc('32014');
        //questionnaireId不存在 格式为非字数字 长度大于1小于
        if(!array_key_exists('questionnaireId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['questionnaireId'])) return ThrowApiExc('32012');
        //type不存在 格式为非字数字 长度不等于1
        if(!array_key_exists('fqaspId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['fqaspId'])) return ThrowApiExc('32016');
        //上传图片
        if(array_key_exists('imgs',$data)&&is_array($data['imgs'])){
            $imgsRe=['jpg','jpeg','png','gif'];
            foreach ($data['imgs'] as $k=>$v){

                if(!in_array($v->getClientOriginalExtension(),$imgsRe)){
                    return ThrowApiExc('32008');
                }

            }
        }

        if(array_key_exists('imgs',$data)&&$data['imgs']){    //判断是否有图片
            $imgurl=array();    //阿里云oss图片的链接

            foreach ($data['imgs'] as $k=>$v) {

                $imgName = date("YmdHis", time()) . rand(1000, 9999) . rand(1000, 9999) . "." . $v->getClientOriginalExtension();  //文件重命名

                $imgurl[$k] = Oss($v, $imgName)['info']['url'];  //通过封装的组件上传阿里云oss

            }
            $data['imgs']=json_encode($imgurl);

        }




        switch ($data['type']){
            case 1:
                //title不存在 格式为空白字符 长度少于2大与20
                if(!array_key_exists('title',$data)||!preg_match('/^[\S]{2,20}$/u',$data['title'])) return ThrowApiExc('32001');
                break;
            default:
                //type不存在 格式为非字数字 长度不等于1
                if(!array_key_exists('important',$data)||!preg_match('/^[\d]{1}$/u',$data['important'])) return ThrowApiExc('32015');
                        //type不存在 格式为非字数字 长度不等于1
                        if(!array_key_exists('problemId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['problemId'])) return ThrowApiExc('32013');

                break;
        }

        $data['createdTime']=date("Y-m-d H:i:s",time());
        $data['updateTime']=date("Y-m-d H:i:s",time());
        $data['createdUid']=$this->uid;
        $data['updateUid']=$this->uid;





        $res = DB::table("q_q_p")->insertGetId($data);





        if($res){
            return [
                'status_code'      => 200,
                'message'     =>  '提交成功',
                'data' => $res
            ];
        }else{
            return [
                'status_code'      => 200,
                'message'     =>  '提交失败 联系后端开发',
                'data' => $res
            ];
        }



    }

    public function update(Request $request,$qpid){
        $data=$request->only('questionnaireId','problemId','fqaspId','type','class','title','where','orderId','important',"img","description","PofP","polymerization","polymerizationType");

        //type不存在 格式为非字数字 长度不等于1
        if(!array_key_exists('type',$data)||!preg_match('/^[\d]{1}$/u',$data['type'])) return ThrowApiExc('32002');
        //type不存在 格式为非字数字 长度不等于1
        if(!array_key_exists('important',$data)||!preg_match('/^[\d]{1}$/u',$data['important'])) return ThrowApiExc('32015');
        //orderId不存在 格式为非字数字 长度不等于1
//        if(!array_key_exists('orderId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['orderId'])) return ThrowApiExc('32014');
        //questionnaireId不存在 格式为非字数字 长度大于1小于
        if(!array_key_exists('questionnaireId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['questionnaireId'])) return ThrowApiExc('32012');

        //上传图片
        if(array_key_exists('imgs',$data)&&is_array($data['imgs'])){
            $imgsRe=['jpg','jpeg','png','gif'];
            foreach ($data['imgs'] as $k=>$v){

                if(!in_array($v->getClientOriginalExtension(),$imgsRe)){
                    return ThrowApiExc('32008');
                }
//
            }
        }

        if(array_key_exists('imgs',$data)&&$data['imgs']){    //判断是否有图片
            $imgurl=array();    //阿里云oss图片的链接

            foreach ($data['imgs'] as $k=>$v) {

                $imgName = date("YmdHis", time()) . rand(1000, 9999) . rand(1000, 9999) . "." . $v->getClientOriginalExtension();  //文件重命名

                $imgurl[$k] = Oss($v, $imgName)['info']['url'];  //通过封装的组件上传阿里云oss

            }
            $data['imgs']=json_encode($imgurl);

        }

        switch ($data['type']){
            case 1:
                //title不存在 格式为空白字符 长度少于2大与20
                if(!array_key_exists('title',$data)||!preg_match('/^[\S]{2,20}$/u',$data['title'])) return ThrowApiExc('32001');
                break;
            default:

                //type不存在 格式为非字数字 长度不等于1
                if(!array_key_exists('problemId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['problemId'])) return ThrowApiExc('32013');
                //type不存在 格式为非字数字 长度不等于1
                if(!array_key_exists('fqaspId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['fqaspId'])) return ThrowApiExc('32016');
                break;
        }





        $qpData = DB::table("q_q_p")->where("id",$qpid)->first();
        $data['version']=$qpData['version']+1;
        $res = DB::table("q_q_p")->where("id",$qpid)->update($data);



        if($res){
            return [
                'status_code'      => 200,
                'message'     =>  '提交成功',
                'data' => $res
            ];
        }else{
            return [
                'status_code'      => 200,
                'message'     =>  '提交失败 联系后端开发',
                'data' => $res
            ];
        }


    }


    public function select(){



    }


    public function add_qp_where(Request $request,$qpid){

        $data = $request->only("relationId","type","value");
        //relationId不存在 格式为非字数字 长度不等于1
        if(!array_key_exists('relationId',$data)||!preg_match('/^[\d]{1,10}$/u',$data['relationId'])) return ThrowApiExc('32020');

        //type不存在 格式为非字数字 长度不等于1
        if(!array_key_exists('type',$data)||!preg_match('/^[\d]{1}$/u',$data['type'])) return ThrowApiExc('32002');

        //qpid不存在 格式为非字数字 长度不等于1
        if(!preg_match('/^[\d]{1,10}$/u',$qpid)) return ThrowApiExc('32022');
        $data['qpid']=$qpid;

        //value不存在 格式为非字数字 长度大于10小于1
        if(!array_key_exists('value',$data)||!preg_match('/^[\d]{1,10}$/u',$data['value'])) return ThrowApiExc('32021');

        $res = DB::table("q_relation")->insertGetId($data);

        if($res){
            return [
                'status_code'      => 200,
                'message'     =>  '提交成功',
                'data' => $res
            ];
        }else{
            return [
                'status_code'      => 200,
                'message'     =>  '提交失败 联系后端开发',
                'data' => $res
            ];
        }

    }

    public function delete_qp_where($qpWhereId){

        //qpid不存在 格式为非字数字 长度不等于1
        if(!preg_match('/^[\d]{1,10}$/u',$qpWhereId)) return ThrowApiExc('32023');

        $res = DB::table("q_relation")->where("id",$qpWhereId)->delete();

        if($res){
            return [
                'status_code'      => 200,
                'message'     =>  '提交成功',
                'data' => $res
            ];
        }else{
            return [
                'status_code'      => 200,
                'message'     =>  '提交失败 联系后端开发',
                'data' => $res
            ];
        }
    }

    public function select_qp_where($qpid){

//        //qpid不存在 格式为非字数字 长度不等于1
//        if(!preg_match('/^[\d]{1,10}$/u',$qpid)) return ThrowApiExc('32022');
//
////        $values = DB::table("q_relation as qr")
////             ->select("value")
////             ->leftJoin("q_q_p as qqp","qr.qpid","=","qqp.id")
////            ->where([
////                [
////                    "qr.qpid",$qpid
////                ]
////            ])
////             ->get();
////        $value=[];
////        foreach ($values as $k=>$v){
////            $value[]=$v['value'];
////        }
////        return $value;
//
////        $res = DB::table("q_relation as qr")
////                    ->select("qa.label","qqp.id as qpid","qr.value as qrvalue","qr.type as qrtype","qp2.title","qr.relationId","qr.id as qpWhereId")
////                    ->leftJoin("q_q_p as qqp","qr.qpid","=","qqp.id")
////                    ->leftJoin("q_q_p as qqp2","qr.relationId","=","qqp2.id")
////                    ->leftJoin("q_problem as qp","qqp.problemId","=","qp.id")
////                    ->leftJoin("q_problem as qp2","qqp2.problemId","=","qp2.id")
////                    ->leftJoin("q_answer as qa","qa.problemId","=","qp.id")
////                    ->where("qr.qpid",$qpid)
////                    ->whereColumn([
////                        [
////                            "qr.value","qa.value"
////                        ]
////                    ])
////                ->get();
//
//        $res = DB::table("q_relation as qr")
//            ->select("qr.type as qrtype","qr.id","qqp.title as qpTitle","qp.title as problemTitle","qa.label")
//            ->leftJoin("q_q_p as qqp","qr.relationId","=","qqp.id")
//            ->leftJoin("q_problem as qp","qp.id","=","qqp.problemId")
//            ->leftJoin("q_answer as qa","qa.problemId","=","qqp.problemId")
//            ->where("qr.qpid",$qpid)
//            ->whereColumn([
//                        [
//                            "qr.value","qa.value"
//                        ]
//                    ])
//            ->get();
//
//
//
//        if($res){
//            return [
//                'status_code'      => 200,
//                'message'     =>  '请求成功',
//                'data' => $res
//            ];
//        }else{
//            return [
//                'status_code'      => 200,
//                'message'     =>  '请求失败 联系后端开发',
//                'data' => $res
//            ];
//        }
        //qpid不存在 格式为非字数字 长度不等于1
        if(!preg_match('/^[\d]{1,10}$/u',$qpid)) return ThrowApiExc('32022');

        $values = DB::table("q_relation as qr")
            ->select("value")
            ->leftJoin("q_q_p as qqp","qr.qpid","=","qqp.id")
            ->where([
                [
                    "qr.qpid",$qpid
                ]
            ])
            ->get();
        $value=[];
        foreach ($values as $k=>$v){
            $value[]=$v['value'];
        }


        $res = DB::table("q_relation as qr")
            ->select("qa.label","qr.value as qrvalue","qr.type as qrtype","qp2.title","qr.relationId","qr.id as qpWhereId")
            ->leftJoin("q_q_p as qqp","qr.qpid","=","qqp.id")
            ->leftJoin("q_q_p as qqp2","qr.relationId","=","qqp2.id")
            ->leftJoin("q_problem as qp","qqp.problemId","=","qp.id")
            ->leftJoin("q_problem as qp2","qqp2.problemId","=","qp2.id")
            ->leftJoin("q_answer as qa","qa.problemId","=","qp.id")
            ->where("qr.qpid",$qpid)
            ->whereColumn([
                [
                    "qr.value","qa.value"
                ]
            ])
            ->get();

        if($res){
            return [
                'status_code'      => 200,
                'message'     =>  '请求成功',
                'data' => $res
            ];
        }else{
            return [
                'status_code'      => 200,
                'message'     =>  '请求失败 联系后端开发',
                'data' => $res
            ];
        }

    }


    public function  delete($qpid){

        $res = DB::table("q_q_p")->select("id")->where("fqaspId",$qpid)->first();  //判断是否有子集

        if($res){
            return ThrowApiExc('32019');
        }

        $res = DB::table("q_q_p")->where("id",$qpid)->delete();
        return [
            'status_code'      => 200,
            'message'     =>  '提交成功',
            'data' => $res
        ];
    }


    public function select_tree(Request $request,$qid){

        $res = DB::table("q_q_p as qqp")
            ->select("qqp.*","qp.title as problemTitle","qp.type as problemType")
            ->leftJoin("q_problem as qp","qp.id","=","qqp.problemId")
            ->where("qqp.questionnaireId",$qid)
            ->orderBy("qqp.orderId")->get()->toArray();
        $res2 = DB::table("q_questionnaire")->where("id",$qid)->first();
        $word = new WordController($request);
        $word->va_word_all($res2['wid']);
        foreach ($res as $k=>$v){
            $res[$k]['title']=$v['id']."||||".$v['title'];
            if($this->va_problemQ($v['id'],$v['problemTitle'],$res2['wid'])||$v['type']!=2){
                $res[$k]['introduce']=1;
            }else{
                $res[$k]['introduce']=0;
            }
        }
        $tree_data = $this->tree($res);

        
        return [
            'status_code'      => 200,
            'message'     =>  '提交成功',
            'data' => [
                "title"=>$res2['title'],
                "data"=>$tree_data
            ]
        ];
    }

    public function tree($data,$fid=0){

        $newArray = array();

            foreach ($data as $k=>$v){
                if($v['fqaspId']==$fid){
                    $addV = $v;
                    $addV['child']=$this->tree($data,$v['id']);
                    $newArray[]=$addV;
                }
            }
        return $newArray;

    }

    public function select_vague(Request $request){
        $title = $request->title;
        $data = DB::table("q_q_p as qqp")
            ->select("qqp.id","qqp.problemId","qqp.title as qpTitle","qp.title as problemTitle ")
            ->leftJoin("q_problem as qp","qqp.problemId","qp.id")
            ->where([
                [
                    "qqp.title","like","%".$title."%"
                ]
            ])
            ->orWhere("qp.title","like","%".$title."%")
            ->get()->toArray();
        foreach ($data as $k=>$v){
            $data[$k]['qpTitle']=$v['id']."|||||".$v['qpTitle'];
            $data[$k]['introduce']=rand(0,1);

            $data[$k]['child']=DB::table("q_answer")->where("problemId",$v['problemId'])->get();
        }
        return $data;
    }

    public function add_wentidemo(){
        // 子女
//        $str = "[{\"title\":\"问 题一：基本信息\",\"questions\":[{\"title\":\"1.孩子的出生日期是？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"2、孩子的姓名是？\",\"id\":\"2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"3、孩子的性别是？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男\",\"value\":\"1\"},{\"label\":\"女\",\"value\":\"2\"}]},{\"title\":\"4、孩子的身份证号是？\",\"id\":\"4\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请输入身份证号\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]},{\"title\":\"问题二：抚养权归属\",\"questions\":[{\"title\":\"5、孩子归谁抚养？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"共同抚养\",\"value\":\"3\"}]},{\"title\":\"6、共同抚养怎么规定？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"具体时间双发自行协商\",\"value\":\"1\"},{\"label\":\"轮流循环抚养\",\"value\":\"2\"},{\"label\":\"按阶段分别抚养\",\"value\":\"3\"}],\"childQuestion\":{\"2\":[{\"title\":\"归男方的时间\",\"id\":\"6_2_1\",\"isRequired\":true,\"type\":\"dateTime_Day_Interval\",\"placeholder\":\"男方抚养时间\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"归女方的时间\",\"id\":\"6_2_2\",\"isRequired\":true,\"type\":\"dateTime_Day_Interval\",\"placeholder\":\"女方抚养时间\",\"tip\":\"提示\",\"answer\":\"\"}],\"3\":[{\"title\":\"归男方的时间\",\"id\":\"6_3_1\",\"isRequired\":true,\"type\":\"dateTime_Day_Interval\",\"placeholder\":\"男方抚养时间\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"归女方的时间\",\"id\":\"6_3_2\",\"isRequired\":true,\"type\":\"dateTime_Day_Interval\",\"placeholder\":\"女方抚养时间\",\"tip\":\"提示\",\"answer\":\"\"}]},\"requireQidAndAnswer\":{\"id\":\"5\",\"answer\":\"3\"}},{\"title\":\"7、女方是否支付抚养费？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}],\"requireQidAndAnswer\":{\"id\":\"5\",\"answer\":\"1\"}},{\"title\":\"8、支付抚养费的方式？\",\"id\":\"8\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"一次性支付\",\"value\":\"1\"},{\"label\":\"按月支付\",\"value\":\"2\"},{\"label\":\"按季度支付\",\"value\":\"3\"},{\"label\":\"按年支付\",\"value\":\"4\"}],\"childQuestion\":{\"1\":[{\"title\":\"时间\",\"id\":\"8_1_1\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"抚养费总额\",\"id\":\"8_1_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"每月\",\"id\":\"8_1_1\",\"isRequired\":true,\"type\":\"select_day_per\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"月抚养费总额\",\"id\":\"8_1_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入月抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"3\":[{\"title\":\"每季度\",\"id\":\"8_3_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"1\",\"value\":\"1\"},{\"label\":\"2\",\"value\":\"2\"},{\"label\":\"3\",\"value\":\"3\"}]},{\"title\":\"月\",\"id\":\"8_3_2\",\"isRequired\":true,\"type\":\"select_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"季度抚养费总额\",\"id\":\"8_3_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入季度抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"4\":[{\"title\":\"每年\",\"id\":\"8_4_1\",\"isRequired\":true,\"type\":\"select_year\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"月\",\"id\":\"8_4_2\",\"isRequired\":true,\"type\":\"select_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"年度抚养费总额\",\"id\":\"8_4_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入季度抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]},\"requireQidAndAnswer\":{\"id\":\"7\",\"answer\":\"1\"}},{\"title\":\"9、支付到哪个账户？\",\"id\":\"9\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"开户名\",\"id\":\"9_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"请输姓名，如：刘德华\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"银行名称\",\"id\":\"9_2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"如：中国工商银行(建外大街支行)\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"账号\",\"id\":\"9_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入银行卡号\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"7\",\"answer\":\"1\"}},{\"title\":\"10、支付到什么时候？\",\"id\":\"10\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"孩子年满十八周岁\",\"value\":\"1\"},{\"label\":\"孩子大学毕业\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}],\"childQuestion\":{\"3\":[{\"title\":\"具体支付时间\",\"id\":\"10_2\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"}]},\"requireQidAndAnswer\":{\"id\":\"7\",\"answer\":\"1\"}},{\"title\":\"11、男方是否支付抚养费？\",\"id\":\"11\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}],\"requireQidAndAnswer\":{\"id\":\"5\",\"answer\":\"2\"}},{\"title\":\"12、支付抚养费的方式？\",\"id\":\"12\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"一次性支付\",\"value\":\"1\"},{\"label\":\"按月支付\",\"value\":\"2\"},{\"label\":\"按季度支付\",\"value\":\"3\"},{\"label\":\"按年支付\",\"value\":\"4\"}],\"childQuestion\":{\"1\":[{\"title\":\"时间\",\"id\":\"8_1_1\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"抚养费总额\",\"id\":\"8_1_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"每月\",\"id\":\"8_1_1\",\"isRequired\":true,\"type\":\"select_day_per\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"月抚养费总额\",\"id\":\"8_1_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入月抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"3\":[{\"title\":\"每季度\",\"id\":\"8_3_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"1\",\"value\":\"1\"},{\"label\":\"2\",\"value\":\"2\"},{\"label\":\"3\",\"value\":\"3\"}]},{\"title\":\"月\",\"id\":\"8_3_2\",\"isRequired\":true,\"type\":\"select_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"季度抚养费总额\",\"id\":\"8_3_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入季度抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"4\":[{\"title\":\"每年\",\"id\":\"8_4_1\",\"isRequired\":true,\"type\":\"select_year\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"月\",\"id\":\"8_4_2\",\"isRequired\":true,\"type\":\"select_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"年度抚养费总额\",\"id\":\"8_4_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入季度抚养费总额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]},\"requireQidAndAnswer\":{\"id\":\"11\",\"answer\":\"1\"}},{\"title\":\"13、支付到哪个账户？\",\"id\":\"13\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"开户名\",\"id\":\"13_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"请输姓名，如：刘德华\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"银行名称\",\"id\":\"13_2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"如：中国工商银行(建外大街支行)\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"账号\",\"id\":\"13_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入银行卡号\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"11\",\"answer\":\"1\"}},{\"title\":\"14、支付到什么时候？\",\"id\":\"14\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"孩子年满十八周岁\",\"value\":\"1\"},{\"label\":\"孩子大学毕业\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}],\"childQuestion\":{\"3\":[{\"title\":\"具体支付时间\",\"id\":\"14_2\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"}]},\"requireQidAndAnswer\":{\"id\":\"11\",\"answer\":\"1\"}},{\"title\":\"是否明确约定女方探望时间？\",\"id\":\"15\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"提示333\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}],\"requireQidAndAnswer\":{\"id\":\"5\",\"answer\":\"1\"}},{\"title\":\"16、怎么探望？\",\"id\":\"16\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"日常探望时间\",\"id\":\"16_1\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择探望时间\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"随时探望\",\"value\":\"1\"},{\"label\":\"定时探望\",\"value\":\"2\"}],\"grandson\":{\"2\":[{\"title\":\"每\",\"id\":\"16_1_2_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"周\",\"value\":\"1\"},{\"label\":\"月\",\"value\":\"2\"},{\"label\":\"年\",\"value\":\"3\"}]},{\"title\":\"探望次数\",\"id\":\"16_1_2_2\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"1\",\"value\":\"1\"},{\"label\":\"2\",\"value\":\"2\"},{\"label\":\"3\",\"value\":\"3\"},{\"label\":\"4\",\"value\":\"4\"},{\"label\":\"5\",\"value\":\"5\"}]},{\"title\":\"每次\",\"id\":\"16_1_2_3\",\"isRequired\":true,\"type\":\"dateTime_Time_Interval\",\"tip\":\"\",\"answer\":\"\"}]}},{\"title\":\"寒暑假探望时间\",\"id\":\"16_2\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择探望时间\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"双方协商确定\",\"value\":\"1\"},{\"label\":\"具体日期\",\"value\":\"2\"}],\"grandson\":{\"2\":[{\"title\":\"具体探望时间\",\"id\":\"16_2_2\",\"isRequired\":true,\"type\":\"dateTime_Day_Interval\",\"tip\":\"\",\"answer\":\"\"}]}}],\"requireQidAndAnswer\":{\"id\":\"15\",\"answer\":\"1\"}},{\"title\":\"是否明确约定女方探望时间？\",\"id\":\"17\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"提示333\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}],\"requireQidAndAnswer\":{\"id\":\"5\",\"answer\":\"2\"}},{\"title\":\"18、怎么探望？\",\"id\":\"18\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"日常探望时间\",\"id\":\"16_1\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择探望时间\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"随时探望\",\"value\":\"1\"},{\"label\":\"定时探望\",\"value\":\"2\"}],\"grandson\":{\"2\":[{\"title\":\"每\",\"id\":\"16_1_2_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"周\",\"value\":\"1\"},{\"label\":\"月\",\"value\":\"2\"},{\"label\":\"年\",\"value\":\"3\"}]},{\"title\":\"探望次数\",\"id\":\"16_1_2_2\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"1\",\"value\":\"1\"},{\"label\":\"2\",\"value\":\"2\"},{\"label\":\"3\",\"value\":\"3\"},{\"label\":\"4\",\"value\":\"4\"},{\"label\":\"5\",\"value\":\"5\"}]},{\"title\":\"每次\",\"id\":\"16_1_2_3\",\"isRequired\":true,\"type\":\"dateTime_Time_Interval\",\"tip\":\"\",\"answer\":\"\"}]}},{\"title\":\"寒暑假探望时间\",\"id\":\"16_2\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择探望时间\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"双方协商确定\",\"value\":\"1\"},{\"label\":\"具体日期\",\"value\":\"2\"}],\"grandson\":{\"2\":[{\"title\":\"具体探望时间\",\"id\":\"16_2_2\",\"isRequired\":true,\"type\":\"dateTime_Day_Interval\",\"tip\":\"\",\"answer\":\"\"}]}}],\"requireQidAndAnswer\":{\"id\":\"17\",\"answer\":\"1\"}}]}]";
//        初始
//        $str = "[{\"title\":\"\",\"questions\":[{\"title\":\"1、您离婚想要达到的诉求是什么？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"要求对方净身出户\",\"value\":\"1\"},{\"label\":\"争夺孩子抚养权\",\"value\":\"2\"},{\"label\":\"以上都是\",\"value\":\"3\"}]},{\"title\":\"2、你们感情破裂的原因是什么？（可多选）\",\"id\":\"2\",\"isRequired\":true,\"type\":\"select_multiple\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"婚前感情基础薄弱\",\"value\":\"1\"},{\"label\":\"性格不合，琐事矛盾\",\"value\":\"2\"},{\"label\":\"出轨\",\"value\":\"3\"},{\"label\":\"与人同居\",\"value\":\"4\"},{\"label\":\"重婚\",\"value\":\"5\"},{\"label\":\"虐待\",\"value\":\"6\"},{\"label\":\"遗弃\",\"value\":\"7\"},{\"label\":\"赌博\",\"value\":\"8\"},{\"label\":\"吸毒\",\"value\":\"9\"},{\"label\":\"沉迷网络游戏\",\"value\":\"10\"},{\"label\":\"嫖娼\",\"value\":\"11\"},{\"label\":\"酗酒\",\"value\":\"12\"},{\"label\":\"暴力倾向\",\"value\":\"13\"},{\"label\":\"家庭成员矛盾\",\"value\":\"14\"},{\"label\":\"子女抚养方面的矛盾\",\"value\":\"15\"},{\"label\":\"隐瞒疾病\",\"value\":\"16\"},{\"label\":\"长期分居两地\",\"value\":\"17\"},{\"label\":\"对方在服刑\",\"value\":\"18\"}]},{\"title\":\"3、你们都是初婚吗？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"均初婚\",\"value\":\"1\"},{\"label\":\"均再婚\",\"value\":\"2\"},{\"label\":\"男方初婚，女方再婚\",\"value\":\"3\"},{\"label\":\"女方初婚，男方再婚\",\"value\":\"4\"}]},{\"title\":\"4、您与配偶生育了几个子女？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"1\",\"value\":\"1\"},{\"label\":\"2\",\"value\":\"2\"},{\"label\":\"3\",\"value\":\"3\"},{\"label\":\"4\",\"value\":\"4\"},{\"label\":\"5\",\"value\":\"5\"},{\"label\":\"6\",\"value\":\"6\"},{\"label\":\"7\",\"value\":\"7\"}]},{\"title\":\"5、是否有需要处理的共同财产？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"无夫妻共同财产\",\"value\":\"1\"},{\"label\":\"有财产待处理\",\"value\":\"2\"}],\"childQuestion\":{\"2\":[{\"title\":\"请勾选您需要处理的夫妻共同财产\",\"id\":\"5_2_1\",\"isRequired\":true,\"type\":\"checkbox\",\"tip\":\"提示\",\"answer\":[],\"listData\":[{\"label\":\"房子\",\"value\":\"1\"},{\"label\":\"存款\",\"value\":\"2\"},{\"label\":\"理财\",\"value\":\"3\"},{\"label\":\"车子\",\"value\":\"4\"},{\"label\":\"家具家电\",\"value\":\"5\"},{\"label\":\"保险\",\"value\":\"6\"},{\"label\":\"其他\",\"value\":\"7\"}],\"grandson\":{\"1\":[{\"title\":\"您与配有有几套房产需要处理？\",\"id\":\"5_2_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"如：3\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"您与配有有几辆车子需要处理？\",\"id\":\"5_2_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"如：3\",\"tip\":\"提示\",\"answer\":\"\"}],\"3\":[{\"title\":\"您与配有有几笔理财需要处理？\",\"id\":\"5_2_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"如：3\",\"tip\":\"提示\",\"answer\":\"\"}],\"4\":[{\"title\":\"您与配有有几项保险需要处理？\",\"id\":\"5_2_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"如：3\",\"tip\":\"提示\",\"answer\":\"\"}]}}]}},{\"title\":\"6、外债的具体情形？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"无外债\",\"value\":\"1\"},{\"label\":\"有外债\",\"value\":\"2\"}],\"childQuestion\":{\"2\":[{\"title\":\"外债的具体情形是\",\"id\":\"6_2_1\",\"isRequired\":true,\"type\":\"checkbox\",\"tip\":\"提示\",\"answer\":[],\"listData\":[{\"label\":\"有债权（别人欠/借你们钱）\",\"value\":\"1\"},{\"label\":\"有债务（你们欠/借了别人钱）\",\"value\":\"2\"}],\"grandson\":{\"1\":[{\"title\":\"您与配有有几笔债权需要处理？\",\"id\":\"6_2_1_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"如：3\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"您与配有有几笔债务需要处理？\",\"id\":\"6_2_1_2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"如：3\",\"tip\":\"提示\",\"answer\":\"\"}]}}]}},{\"title\":\"7、您与配偶对离婚是否达成一致？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"2\"}],\"childQuestion\":{\"2\":[{\"title\":\"您与配偶对离婚的争议是什么？\",\"id\":\"7_2_1\",\"isRequired\":true,\"type\":\"checkbox\",\"tip\":\"提示\",\"answer\":[],\"listData\":[{\"label\":\"子女\",\"value\":\"1\"},{\"label\":\"财产\",\"value\":\"2\"},{\"label\":\"外债\",\"value\":\"3\"}]}]}}]}]";
//        理财
//        $str = "[{\"title\":\"问题一：基本信息\",\"questions\":[{\"title\":\"1、理财机构是？\",\"id\":\"1\",\"isRequired\":false,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"填写机构名称即可\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"2、理财数额共计人民币多少元？\",\"id\":\"2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"如：5000\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、在谁名下？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]}]},{\"title\":\"问题二：离婚后理财归属\",\"questions\":[{\"title\":\"4、离婚后这项理财归谁？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"男方和女方\",\"value\":\"3\"},{\"label\":\"孩子\",\"value\":\"4\"},{\"label\":\"男方和孩子\",\"value\":\"5\"},{\"label\":\"女方和孩子\",\"value\":\"6\"},{\"label\":\"男方、女方和孩子\",\"value\":\"7\"}],\"childQuestion\":{\"1\":[{\"title\":\"男方拥有数额\",\"id\":\"2_1_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"女方拥有数额\",\"id\":\"2_2_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"3\":[{\"title\":\"男方拥有数额\",\"id\":\"2_3_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"女方拥有数额\",\"id\":\"2_3_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"4\":[{\"title\":\"孩子拥有数额\",\"id\":\"2_4_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_4_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}],\"5\":[{\"title\":\"男方拥有数额\",\"id\":\"2_5_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子方拥有数额\",\"id\":\"2_5_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_5_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}],\"6\":[{\"title\":\"女方拥有数额\",\"id\":\"2_6_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子方拥有数额\",\"id\":\"2_6_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_6_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}],\"7\":[{\"title\":\"男方拥有数额\",\"id\":\"2_7_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"女方拥有数额\",\"id\":\"2_7_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子方拥有数额\",\"id\":\"2_7_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_7_4\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}]}},{\"title\":\"5、是否约定理财的分割时间\",\"id\":\"5\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"无需约定/双方另行约定\",\"value\":\"1\"},{\"label\":\"本协议生效之日起\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}]},{\"title\":\"6具体时间？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"选择具体时间\",\"tip\":\"\",\"answer\":\"\",\"requireQidAndAnswer\":{\"id\":\"5\",\"answer\":\"3\"}}]}]";
//        车子
//        $str = "[{\"title\":\"问题一：基本信息\",\"questions\":[{\"title\":\"1、花多少钱购买的？\",\"id\":\"1\",\"isRequired\":false,\"type\":\"input\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"2、什么时间购买的？\",\"id\":\"2\",\"isRequired\":false,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、由谁出钱购买?（可多选）\",\"id\":\"3\",\"isRequired\":true,\"type\":\"select_multiple\",\"tip\":\"\",\"answer\":[],\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"男方父母\",\"value\":\"2\"},{\"label\":\"女方\",\"value\":\"3\"},{\"label\":\"女方父母\",\"value\":\"4\"},{\"label\":\"双方\",\"value\":\"5\"},{\"label\":\"双方父母\",\"value\":\"6\"}]},{\"title\":\"4、车子登记在谁名下？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"5、车子的品牌是？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"6、车子的型号是？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"7、车子的种类是？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"小型汽车\",\"value\":\"1\"},{\"label\":\"客车\",\"value\":\"2\"},{\"label\":\"货车\",\"value\":\"3\"},{\"label\":\"三轮车\",\"value\":\"4\"},{\"label\":\"两轮摩托车\",\"value\":\"5\"},{\"label\":\"电车\",\"value\":\"6\"}]},{\"title\":\"8、车牌号是多少？\",\"id\":\"8\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"}]},{\"title\":\"问题二：离婚后车子归属\",\"questions\":[{\"title\":\"9、离婚后车子归谁？\",\"id\":\"9\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":[],\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"孩子\",\"value\":\"3\"}],\"childQuestion\":{\"3\":[{\"title\":\"孩子的姓名\",\"id\":\"9_3_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写孩子的姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}]}},{\"title\":\"10、是否支付对方补偿款？\",\"id\":\"10\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}],\"childQuestion\":{\"1\":[{\"title\":\"（1）支付多少补偿\",\"id\":\"10_1_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"如：男方支付女方2000元\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"（2）什么时候支付\",\"id\":\"10_1_2\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"选择支付时间\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"（3）收款账户 开户名\",\"id\":\"10_1_3\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"请输姓名，如：刘德华\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"银行名称\",\"id\":\"10_1_4\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"如：中国工商银行(建外大街支行)\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"账号\",\"id\":\"10_1_5\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入银行卡号\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}]}},{\"title\":\"11、是否约定车子分割履行时间？\",\"id\":\"11\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"不涉及更名问题，无需更名过户\",\"value\":\"1\"},{\"label\":\"需要更名过户，需约定具体事宜\",\"value\":\"2\"}]},{\"title\":\"12、什么时间更名过户\",\"id\":\"12\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"双方协商确定\",\"value\":\"1\"},{\"label\":\"符合过户条件即日起\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}],\"requireQidAndAnswer\":{\"id\":\"11\",\"answer\":\"2\"}},{\"title\":\"具体时间？\",\"id\":\"13\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"选择具体时间\",\"tip\":\"\",\"answer\":\"\",\"requireQidAndAnswer\":{\"id\":\"12\",\"answer\":\"3\"}},{\"title\":\"14、谁承担过户费\",\"id\":\"14\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"双方\",\"value\":\"3\"}],\"requireQidAndAnswer\":{\"id\":\"11\",\"answer\":\"2\"}}]}]";
//        家电
//        $str = "[{\"title\":\"\",\"questions\":[{\"title\":\"1、需要分割的家电名称、数量和归属？\",\"id\":\"1\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"名称、数量\",\"id\":\"1_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"（示例：iphoneX手机一部）\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"归谁所有\",\"id\":\"1_2\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]}]},{\"title\":\"2、价值共计多少？\",\"id\":\"2\",\"isRequired\":false,\"type\":\"input\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、是否支付对方差价？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}]},{\"title\":\"4、支付多少差价？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"\",\"id\":\"4_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"支付\",\"id\":\"4_2\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"差价\",\"id\":\"4_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"￥，支付多少钱\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"3\",\"answer\":\"1\"}},{\"title\":\"（2）、什么时候支付\",\"id\":\"5\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"无需约定/双方另行约定\",\"value\":\"1\"},{\"label\":\"本协议生效之日起\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}],\"requireQidAndAnswer\":{\"id\":\"3\",\"answer\":\"1\"}},{\"title\":\"具体时间？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"选择具体时间\",\"tip\":\"\",\"answer\":\"\",\"requireQidAndAnswer\":{\"id\":\"5\",\"answer\":\"3\"}},{\"title\":\"(3)、收款账户？\",\"id\":\"9\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"开户名\",\"id\":\"9_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"请输姓名，如：刘德华\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"银行名称\",\"id\":\"9_2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"如：中国工商银行(建外大街支行)\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"账号\",\"id\":\"9_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入银行卡号\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"3\",\"answer\":\"1\"}}]}]";
//        房产
//        $str = "[{\"title\":\"问题一：基本信息\",\"questions\":[{\"title\":\"房子的地址是\",\"id\":\"1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"2.什么时间购买的？\",\"id\":\"2\",\"isRequired\":false,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、由谁出钱购买？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"select_multiple\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"男方\"},{\"label\":\"男方父母\",\"value\":\"男方父母\"},{\"label\":\"女方\",\"value\":\"女方\"},{\"label\":\"女方父母\",\"value\":\"女方父母\"},{\"label\":\"双方\",\"value\":\"双方\"},{\"label\":\"双方父母\",\"value\":\"双方父母\"}]},{\"title\":\"4、全款还是贷款？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"全款\",\"value\":\"1\"},{\"label\":\"贷款\",\"value\":\"2\"}],\"childQuestion\":{\"1\":[{\"title\":\"全款额多少？\",\"id\":\"4_1_1\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"￥，请输入金额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"首付金额多少？\",\"id\":\"4_2_1\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"￥，请输入金额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"剩余贷款多少多少？\",\"id\":\"4_2_2\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"￥，请输入金额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]}},{\"title\":\"5、有没有房产证？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"无\",\"value\":\"1\"},{\"label\":\"有\",\"value\":\"2\"}],\"childQuestion\":{\"1\":[{\"title\":\"以谁的名义签订的购房合同？\",\"id\":\"5_1_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"双方\",\"value\":\"2\"}]},{\"title\":\"与谁签订的购房合同\",\"id\":\"5_1_2\",\"isRequired\":false,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"合同全称\",\"id\":\"5_1_3\",\"isRequired\":false,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"房产证号\",\"id\":\"5_2_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"男方抚养时间\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"房子登记在谁名下\",\"id\":\"5_2_2\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"男方\"},{\"label\":\"女方\",\"value\":\"女方\"},{\"label\":\"双方\",\"value\":\"双方\"}]},{\"title\":\"男方拥有份额\",\"id\":\"5_2_3\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"女方拥有份额\",\"id\":\"5_2_4\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}]}}]},{\"title\":\"问题二：离婚后房子归属\",\"questions\":[{\"title\":\"6、离婚后房子归谁？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"select_multiple\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"男方\"},{\"label\":\"女方\",\"value\":\"女方\"},{\"label\":\"孩子\",\"value\":\"孩子\"}]},{\"title\":\"7、是否支付对方补偿款？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"2\"}]},{\"title\":\"8、剩余贷款由谁偿还？\",\"id\":\"8\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"双方\",\"value\":\"3\"}]},{\"title\":\"9、是否约定过户更名事宜？\",\"id\":\"9\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"不涉及更名问题，无需根明过户\",\"value\":\"0\"},{\"label\":\"需要更名过户，需约定具体事宜\",\"value\":\"1\"}]},{\"title\":\"10、剩余贷款由谁偿还？\",\"id\":\"10\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"随房走\",\"value\":\"1\"},{\"label\":\"另行约定\",\"value\":\"2\"}]}]}]";
//        债权
//        $str = "[{\"title\":\"问题一：基本信息\",\"questions\":[{\"title\":\"1、别人欠/借你们多少钱？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"2、欠款/借款人姓名？\",\"id\":\"2\",\"isRequired\":false,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"}]},{\"title\":\"问题二：离婚后债权归属(谁负责找欠钱的人还钱)\",\"questions\":[{\"title\":\"3、离婚后谁负责向欠款/借款人收回欠款/借款？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":[],\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"双方共同\",\"value\":\"3\"}],\"childQuestion\":{\"3\":[{\"title\":\"男方拥有份额\",\"id\":\"3_3_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如50%\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"女方拥有份额\",\"id\":\"3_3_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如50%\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]}},{\"title\":\"4、是否支付对方补偿款？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}]},{\"title\":\"（1）、支付多少差价？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"\",\"id\":\"5_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"支付\",\"id\":\"5_2\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"差价\",\"id\":\"5_3\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"￥，支付多少钱\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"4\",\"answer\":\"1\"}},{\"title\":\"（2）、什么时候支付\",\"id\":\"6\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"无需约定/双方另行约定\",\"value\":\"1\"},{\"label\":\"本协议生效之日起\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}],\"requireQidAndAnswer\":{\"id\":\"4\",\"answer\":\"1\"}},{\"title\":\"具体时间？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"选择具体时间\",\"tip\":\"\",\"answer\":\"\",\"requireQidAndAnswer\":{\"id\":\"6\",\"answer\":\"3\"}},{\"title\":\"(3)、收款账户？\",\"id\":\"8\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"开户名\",\"id\":\"8_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"请输姓名，如：刘德华\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"银行名称\",\"id\":\"8_2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"如：中国工商银行(建外大街支行)\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"账号\",\"id\":\"8_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入银行卡号\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"4\",\"answer\":\"1\"}}]}]";
//        保险
//        $str = "[{\"title\":\"问题一：基本信息\",\"questions\":[{\"title\":\"1、保险的名称是？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"2、哪个保险公司的保险？\",\"id\":\"2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、保险数额多少？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"￥，请输入金额，如：50000\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"4、什么时间投保的？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"5、投保人是谁？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"6、被保险人姓名？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"7、受益人姓名？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"}]},{\"title\":\"问题二：离婚后保险收益归属\",\"questions\":[{\"title\":\"8、离婚后保险归谁？\",\"id\":\"8\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"孩子\",\"value\":\"3\"}]},{\"title\":\"9、剩余保费谁承担？\",\"id\":\"9\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"10、是否支付对方补偿款？\",\"id\":\"10\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}],\"childQuestion\":{\"1\":[{\"title\":\"（1）支付多少补偿\",\"id\":\"10_1_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"如：男方支付女方2000元\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"（2）什么时候支付\",\"id\":\"10_1_2\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"选择支付时间\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"（3）收款账户 开户名\",\"id\":\"10_1_3\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"请输姓名，如：刘德华\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"银行名称\",\"id\":\"10_1_4\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"如：中国工商银行(建外大街支行)\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"账号\",\"id\":\"10_1_5\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入银行卡号\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}]}}]}]";
//        存款
//        $str = "[{\"title\":\"问题一：基本信息\",\"questions\":[{\"title\":\"1、存款在谁名下？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"双方都有\",\"value\":\"3\"}],\"childQuestion\":{\"1\":[{\"title\":\"存款银行\",\"id\":\"1_1_1\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请选择银行\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"存款账号\",\"id\":\"1_1_2\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请输入账号\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"以上存款共计人民币多少？\",\"id\":\"1_1_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"￥，请输入金额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"存款银行\",\"id\":\"1_1_1\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请选择银行\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"存款账号\",\"id\":\"1_1_2\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请输入账号\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"以上存款共计人民币多少？\",\"id\":\"1_1_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"￥，请输入金额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"3\":[{\"title\":\"男方名下存款\",\"questions\":[{\"title\":\"存款银行\",\"id\":\"1_1_1\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请选择银行\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"存款账号\",\"id\":\"1_1_2\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请输入账号\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"以上存款共计人民币多少？\",\"id\":\"1_1_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"￥，请输入金额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]},{\"title\":\"女方名下存款\",\"questions\":[{\"title\":\"存款银行\",\"id\":\"1_1_1\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请选择银行\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"存款账号\",\"id\":\"1_1_2\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请输入账号\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"以上存款共计人民币多少？\",\"id\":\"1_1_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"￥，请输入金额\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]}]}}]},{\"title\":\"问题二：离婚后存款归属\",\"questions\":[{\"title\":\"2、离婚后存款归谁？\",\"id\":\"2\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"男方和女方\",\"value\":\"3\"},{\"label\":\"孩子\",\"value\":\"4\"},{\"label\":\"男方和孩子\",\"value\":\"5\"},{\"label\":\"女方和孩子\",\"value\":\"6\"},{\"label\":\"男方、女方和孩子\",\"value\":\"7\"}],\"childQuestion\":{\"1\":[{\"title\":\"男方拥有数额\",\"id\":\"2_1_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"2\":[{\"title\":\"女方拥有数额\",\"id\":\"2_2_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"3\":[{\"title\":\"男方拥有数额\",\"id\":\"2_3_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"女方拥有数额\",\"id\":\"2_3_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}],\"4\":[{\"title\":\"孩子拥有数额\",\"id\":\"2_4_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_4_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}],\"5\":[{\"title\":\"男方拥有数额\",\"id\":\"2_5_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子方拥有数额\",\"id\":\"2_5_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_5_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}],\"6\":[{\"title\":\"女方拥有数额\",\"id\":\"2_6_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子方拥有数额\",\"id\":\"2_6_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_6_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}],\"7\":[{\"title\":\"男方拥有数额\",\"id\":\"2_7_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"女方拥有数额\",\"id\":\"2_7_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子方拥有数额\",\"id\":\"2_7_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如：80\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"孩子的姓名\",\"id\":\"2_7_4\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请填写孩子姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}]}},{\"title\":\"3、是否约定存款分割履行时间？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"无需约定/双方另行约定\",\"value\":\"1\"},{\"label\":\"本协议生效之日起\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}],\"childQuestion\":{\"3\":[{\"title\":\"具体履行时间是\",\"id\":\"3_3_1\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"请填写具体履行时间\",\"tip\":\"提示\",\"answer\":\"\"}]}}]}]";
//        其他财产
//        $str = "[{\"title\":\"其他财产\",\"questions\":[{\"title\":\"请选择您与配偶需要处理的其他财产？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"checkbox\",\"tip\":\"\",\"answer\":[],\"listData\":[{\"label\":\"股权股份\",\"value\":\"1\"},{\"label\":\"网上店铺\",\"value\":\"2\"},{\"label\":\"虚拟财产\",\"value\":\"3\"},{\"label\":\"住房公积金\",\"value\":\"4\"},{\"label\":\"知识产权收益\",\"value\":\"5\"},{\"label\":\"军人复原费、自主择业费\",\"value\":\"6\"},{\"label\":\"买断工龄款\",\"value\":\"7\"},{\"label\":\"宅基地相关\",\"value\":\"8\"},{\"label\":\"珠宝首饰\",\"value\":\"9\"},{\"label\":\"宠物\",\"value\":\"10\"},{\"label\":\"收藏品、古董\",\"value\":\"11\"},{\"label\":\"铺位承租权、转租权\",\"value\":\"12\"},{\"label\":\"承包土地、山林\",\"value\":\"13\"},{\"label\":\"体育竞技奖牌、奖金\",\"value\":\"14\"}]},{\"title\":\"其他\",\"id\":\"2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写其他财产\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}]}]";
//        欠款
//        $str = "[{\"title\":\"问题一：基本信息\",\"questions\":[{\"title\":\"1、我们欠/借别人多少钱？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"2、欠了/借了谁的钱？\",\"id\":\"2\",\"isRequired\":false,\"type\":\"input\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"}]},{\"title\":\"问题二：离婚后债务承担\",\"questions\":[{\"title\":\"3、离婚后谁负责还债？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":[],\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"},{\"label\":\"双方共同\",\"value\":\"3\"}],\"childQuestion\":{\"3\":[{\"title\":\"男方承担份额\",\"id\":\"3_3_1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如50%\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"女方承担份额\",\"id\":\"3_3_2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"填写百分比，如50%\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"}]}},{\"title\":\"4、是否支付对方补偿款？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"radio\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"是\",\"value\":\"1\"},{\"label\":\"否\",\"value\":\"0\"}]},{\"title\":\"（1）、支付多少差价？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"\",\"id\":\"5_1\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"支付\",\"id\":\"5_2\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"\",\"answer\":\"\",\"listData\":[{\"label\":\"男方\",\"value\":\"1\"},{\"label\":\"女方\",\"value\":\"2\"}]},{\"title\":\"差价\",\"id\":\"5_3\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"number\",\"placeholder\":\"￥，支付多少钱\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"4\",\"answer\":\"1\"}},{\"title\":\"（2）、什么时候支付\",\"id\":\"6\",\"isRequired\":true,\"type\":\"select\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"无需约定/双方另行约定\",\"value\":\"1\"},{\"label\":\"本协议生效之日起\",\"value\":\"2\"},{\"label\":\"具体时间\",\"value\":\"3\"}],\"requireQidAndAnswer\":{\"id\":\"4\",\"answer\":\"1\"}},{\"title\":\"具体时间？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"选择具体时间\",\"tip\":\"\",\"answer\":\"\",\"requireQidAndAnswer\":{\"id\":\"6\",\"answer\":\"3\"}},{\"title\":\"(3)、收款账户？\",\"id\":\"8\",\"isRequired\":false,\"type\":\"question\",\"tip\":\"\",\"childQuestion\":[{\"title\":\"开户名\",\"id\":\"8_1\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"请输姓名，如：刘德华\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"银行名称\",\"id\":\"8_2\",\"isRequired\":true,\"type\":\"input\",\"input_type\":\"text\",\"placeholder\":\"如：中国工商银行(建外大街支行)\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"账号\",\"id\":\"8_3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入银行卡号\",\"input_type\":\"number\",\"tip\":\"\",\"answer\":\"\"}],\"requireQidAndAnswer\":{\"id\":\"4\",\"answer\":\"1\"}}]}]";
//          双方基本信息
          $str = "[{\"title\":\"问题一：男方基本信息\",\"questions\":[{\"title\":\"1、男方的姓名是？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"2.男方的出生日期是？\",\"id\":\"2\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、男方的联系方式是？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入联系方式\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"4、男方身份证件类型是？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择证件号\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"居民身份证\",\"value\":\"1\"},{\"label\":\"港澳身份证\",\"value\":\"2\"},{\"label\":\"护照\",\"value\":\"3\"},{\"label\":\"士官证\",\"value\":\"4\"},{\"label\":\"其他\",\"value\":\"5\"}]},{\"title\":\"证件号码是？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入证件号\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"5、男方的国籍是？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择国籍\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"中国\",\"value\":\"1\"},{\"label\":\"美国\",\"value\":\"2\"},{\"label\":\"韩国\",\"value\":\"3\"},{\"label\":\"法国\",\"value\":\"4\"},{\"label\":\"日本\",\"value\":\"5\"},{\"label\":\"英国\",\"value\":\"6\"},{\"label\":\"法国\",\"value\":\"7\"},{\"label\":\"其他\",\"value\":\"8\"}],\"childQuestion\":{\"1\":[{\"title\":\"民族\",\"id\":\"6_1_1\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择民族\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"value\":\"1\",\"label\":\"汉族\"},{\"value\":\"2\",\"label\":\"蒙古族\"},{\"value\":\"3\",\"label\":\"回族\"},{\"value\":\"4\",\"label\":\"藏族\"},{\"value\":\"5\",\"label\":\"维吾尔族\"},{\"value\":\"6\",\"label\":\"苗族\"},{\"value\":\"7\",\"label\":\"彝族\"},{\"value\":\"8\",\"label\":\"壮族\"},{\"value\":\"9\",\"label\":\"布依族\"},{\"value\":\"10\",\"label\":\"朝鲜族\"},{\"value\":\"11\",\"label\":\"满族\"},{\"value\":\"12\",\"label\":\"侗族\"},{\"value\":\"13\",\"label\":\"瑶族\"},{\"value\":\"14\",\"label\":\"白族\"},{\"value\":\"15\",\"label\":\"土家族\"},{\"value\":\"16\",\"label\":\"哈尼族\"},{\"value\":\"17\",\"label\":\"哈萨克族\"},{\"value\":\"18\",\"label\":\"傣族\"},{\"value\":\"19\",\"label\":\"黎族\"},{\"value\":\"20\",\"label\":\"傈僳族\"},{\"value\":\"21\",\"label\":\"佤族\"},{\"value\":\"22\",\"label\":\"畲族\"},{\"value\":\"23\",\"label\":\"高山族\"},{\"value\":\"24\",\"label\":\"拉祜族\"},{\"value\":\"25\",\"label\":\"水族\"},{\"value\":\"26\",\"label\":\"东乡族\"},{\"value\":\"27\",\"label\":\"纳西族\"},{\"value\":\"28\",\"label\":\"景颇族\"},{\"value\":\"29\",\"label\":\"柯尔克孜族\"},{\"value\":\"30\",\"label\":\"土族\"},{\"value\":\"31\",\"label\":\"达翰尔族\"},{\"value\":\"32\",\"label\":\"么佬族\"},{\"value\":\"33\",\"label\":\"羌族\"},{\"value\":\"34\",\"label\":\"布朗族\"},{\"value\":\"35\",\"label\":\"撒拉族\"},{\"value\":\"36\",\"label\":\"毛南族\"},{\"value\":\"37\",\"label\":\"仡佬族\"},{\"value\":\"38\",\"label\":\"锡伯族\"},{\"value\":\"39\",\"label\":\"阿昌族\"},{\"value\":\"40\",\"label\":\"普米族\"},{\"value\":\"41\",\"label\":\"塔吉克族\"},{\"value\":\"42\",\"label\":\"怒族\"},{\"value\":\"43\",\"label\":\"乌孜别克族\"},{\"value\":\"44\",\"label\":\"俄罗斯族\"},{\"value\":\"45\",\"label\":\"鄂温克族\"},{\"value\":\"46\",\"label\":\"德昂族\"},{\"value\":\"47\",\"label\":\"保安族\"},{\"value\":\"48\",\"label\":\"裕固族\"},{\"value\":\"49\",\"label\":\"京族\"},{\"value\":\"50\",\"label\":\"塔塔尔族\"},{\"value\":\"51\",\"label\":\"独龙族\"},{\"value\":\"52\",\"label\":\"鄂伦春族\"},{\"value\":\"53\",\"label\":\"赫哲族\"},{\"value\":\"54\",\"label\":\"门巴族\"},{\"value\":\"55\",\"label\":\"珞巴族\"},{\"value\":\"56\",\"label\":\"基诺族\"}]}]}},{\"title\":\"6、男方住址是？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"与身份证地址一致\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}]},{\"title\":\"问题二：女方基本信息\",\"questions\":[{\"title\":\"1、女方的姓名是？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入姓名\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"2.女方的出生日期是？\",\"id\":\"2\",\"isRequired\":true,\"type\":\"dateTime_day\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、女方的联系方式是？\",\"id\":\"3\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入联系方式\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"4、女方身份证件类型是？\",\"id\":\"4\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择证件号\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"居民身份证\",\"value\":\"1\"},{\"label\":\"港澳身份证\",\"value\":\"2\"},{\"label\":\"护照\",\"value\":\"3\"},{\"label\":\"士官证\",\"value\":\"4\"},{\"label\":\"其他\",\"value\":\"5\"}]},{\"title\":\"证件号码是？\",\"id\":\"5\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"请输入证件号\",\"input_type\":\"number\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"5、女方的国籍是？\",\"id\":\"6\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择国籍\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"label\":\"中国\",\"value\":\"1\"},{\"label\":\"美国\",\"value\":\"2\"},{\"label\":\"韩国\",\"value\":\"3\"},{\"label\":\"法国\",\"value\":\"4\"},{\"label\":\"日本\",\"value\":\"5\"},{\"label\":\"英国\",\"value\":\"6\"},{\"label\":\"法国\",\"value\":\"7\"},{\"label\":\"其他\",\"value\":\"8\"}],\"childQuestion\":{\"1\":[{\"title\":\"民族\",\"id\":\"6_1_1\",\"isRequired\":true,\"type\":\"select\",\"placeholder\":\"请选择民族\",\"tip\":\"提示\",\"answer\":\"\",\"listData\":[{\"value\":\"1\",\"label\":\"汉族\"},{\"value\":\"2\",\"label\":\"蒙古族\"},{\"value\":\"3\",\"label\":\"回族\"},{\"value\":\"4\",\"label\":\"藏族\"},{\"value\":\"5\",\"label\":\"维吾尔族\"},{\"value\":\"6\",\"label\":\"苗族\"},{\"value\":\"7\",\"label\":\"彝族\"},{\"value\":\"8\",\"label\":\"壮族\"},{\"value\":\"9\",\"label\":\"布依族\"},{\"value\":\"10\",\"label\":\"朝鲜族\"},{\"value\":\"11\",\"label\":\"满族\"},{\"value\":\"12\",\"label\":\"侗族\"},{\"value\":\"13\",\"label\":\"瑶族\"},{\"value\":\"14\",\"label\":\"白族\"},{\"value\":\"15\",\"label\":\"土家族\"},{\"value\":\"16\",\"label\":\"哈尼族\"},{\"value\":\"17\",\"label\":\"哈萨克族\"},{\"value\":\"18\",\"label\":\"傣族\"},{\"value\":\"19\",\"label\":\"黎族\"},{\"value\":\"20\",\"label\":\"傈僳族\"},{\"value\":\"21\",\"label\":\"佤族\"},{\"value\":\"22\",\"label\":\"畲族\"},{\"value\":\"23\",\"label\":\"高山族\"},{\"value\":\"24\",\"label\":\"拉祜族\"},{\"value\":\"25\",\"label\":\"水族\"},{\"value\":\"26\",\"label\":\"东乡族\"},{\"value\":\"27\",\"label\":\"纳西族\"},{\"value\":\"28\",\"label\":\"景颇族\"},{\"value\":\"29\",\"label\":\"柯尔克孜族\"},{\"value\":\"30\",\"label\":\"土族\"},{\"value\":\"31\",\"label\":\"达翰尔族\"},{\"value\":\"32\",\"label\":\"么佬族\"},{\"value\":\"33\",\"label\":\"羌族\"},{\"value\":\"34\",\"label\":\"布朗族\"},{\"value\":\"35\",\"label\":\"撒拉族\"},{\"value\":\"36\",\"label\":\"毛南族\"},{\"value\":\"37\",\"label\":\"仡佬族\"},{\"value\":\"38\",\"label\":\"锡伯族\"},{\"value\":\"39\",\"label\":\"阿昌族\"},{\"value\":\"40\",\"label\":\"普米族\"},{\"value\":\"41\",\"label\":\"塔吉克族\"},{\"value\":\"42\",\"label\":\"怒族\"},{\"value\":\"43\",\"label\":\"乌孜别克族\"},{\"value\":\"44\",\"label\":\"俄罗斯族\"},{\"value\":\"45\",\"label\":\"鄂温克族\"},{\"value\":\"46\",\"label\":\"德昂族\"},{\"value\":\"47\",\"label\":\"保安族\"},{\"value\":\"48\",\"label\":\"裕固族\"},{\"value\":\"49\",\"label\":\"京族\"},{\"value\":\"50\",\"label\":\"塔塔尔族\"},{\"value\":\"51\",\"label\":\"独龙族\"},{\"value\":\"52\",\"label\":\"鄂伦春族\"},{\"value\":\"53\",\"label\":\"赫哲族\"},{\"value\":\"54\",\"label\":\"门巴族\"},{\"value\":\"55\",\"label\":\"珞巴族\"},{\"value\":\"56\",\"label\":\"基诺族\"}]}]}},{\"title\":\"6、女方住址是？\",\"id\":\"7\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"与身份证地址一致\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"}]}]";
//          婚姻状况
//          $str = "[{\"title\":\"\",\"questions\":[{\"title\":\"1、你们是哪天领取结婚证的？\",\"id\":\"1\",\"isRequired\":true,\"type\":\"dateTime_day\",\"placeholder\":\"请选择日期\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"2.你们是在哪个民政局登记的？\",\"id\":\"2\",\"isRequired\":true,\"type\":\"input\",\"placeholder\":\"如：河北省石家庄市正定县\",\"input_type\":\"text\",\"tip\":\"\",\"answer\":\"\"},{\"title\":\"3、结婚证字号是多少？\",\"id\":\"3\",\"isRequired\":false,\"type\":\"input\",\"placeholder\":\"请输入字号\",\"input_type\":\"text\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"4、你们相识的时间是？\",\"id\":\"4\",\"isRequired\":false,\"type\":\"dateTime_day\",\"placeholder\":\"请选择日期\",\"tip\":\"提示\",\"answer\":\"\"},{\"title\":\"5、你们恋爱的时间是？\",\"id\":\"5\",\"isRequired\":false,\"type\":\"dateTime_day\",\"placeholder\":\"请选择日期\",\"tip\":\"提示\",\"answer\":\"\"}]}]";
          $data = json_decode($str);
        return $data;
//        $this->returnQpId($data,3);
//        $this->addRelation($data);
    }


    public function returnQpId($data,$fid){

        foreach ($data as $k=>$v){
            if(is_array($v)){
                $this->returnQpId($v,$fid);
            }else{

            if($v->title==""){
                $v->title="临时";
            }

                $sqlData = array();
                $sqlData['questionnaireId']=3;
                $sqlData['fqaspId']=$fid;
                $sqlData['createdTime']=date("Y-m-d H:i:s",time());
                $sqlData['updateTime']=date("Y-m-d H:i:s",time());
                $sqlData['createdUid']=$this->uid;
                $sqlData['updateUid']=$this->uid;
                $sqlData['orderId']=0;
                $sqlData['title']=$v->title;

//                var_dump($v->title);
                if(property_exists($v,'type')){
                    $sqlData['linshiid']=$v->id;

                    $sqlData['type']=2;
//
                        $typeArr=[
                                'input'=>1,
                                'dateTime_day'=>3,
                                'dateTime_Day_Interval'=>4,
                                'dateTime_Time_Interval'=>5,
                                'radio'=>6,
                                'checkbox'=>7,
                                'select'=>8,
                                'select_multiple'=>9,
                                'select_day_per'=>10,
                                'select_day'=>11,
                                'select_year'=>11,
                                'question'=>11,
                            ];

                            $select_title  = DB::table("q_problem")->where("title",$v->title)->first();
                            if($select_title){
                                $problemId=$select_title['id'];
                            }else {
                                $proAddDate = array();
                                $proAddDate['createdTime'] = date("Y-m-d H:i:s", time());
                                $proAddDate['updateTime'] = date("Y-m-d H:i:s", time());
                                $proAddDate['createdUid'] = $this->uid;
                                $proAddDate['updateUid'] = $this->uid;
                                $proAddDate['title'] = $v->title;
                                $proAddDate['type'] = $typeArr[$v->type];
                                $proAddDate['status'] = 2;
                                $problemId = DB::table("q_problem")->insertGetId($proAddDate);

                                if (property_exists($v, 'listData')) {
                                    $answerAddData = [];
                                    $value = 1;
                                    foreach ($v->listData as $kk => $vv) {
                                        $answerAddData[] = [
                                            'value' => $value,
                                            'label' => $vv->label,
                                            'status' => 1,
                                            'problemId' => $problemId,
                                            'createdUid' => $this->uid,
                                            'createdTime' => date("Y-m-d H:i:s", time())
                                        ];
                                        $value++;
                                    }
                                    DB::table("q_answer")->insert($answerAddData);
                                }

                                $sqlData['problemId'] = $problemId;
                                $sqlData['type'] = 2;
                            }
                }else{
                    $sqlData['type']=1;

                }

                $res = DB::table("q_q_p")->insertGetId($sqlData);

                if(property_exists($v,'questions')){
                    $this->returnQpId($v->questions,$res);

                }

                if(property_exists($v,'childQuestion')){
                    $this->returnQpId($v->childQuestion,$res);

                }

                if(property_exists($v,'grandson')){
                    $this->returnQpId($v->grandson,$res);
                }

                if(property_exists($v,'requireQidAndAnswer')){
                    $add_require=array();
                    $add_require['qpid']=$res;

                    $add_require['relationId']=DB::table("q_q_p")->where("linshiid",$v->requireQidAndAnswer->id)->first()['id'];
                    $add_require['value']=$v->requireQidAndAnswer->answer;
                    $add_require['type']=1;
                    DB::table("q_relation")->insertGetId($add_require);

                }

            }
        }



    }

    public function addRelation($data)
    {

        foreach ($data as $k => $v) {
            if (is_array($v)) {
                $this->addRelation($v);
            } else {

                if(property_exists($v,'questions')){
                    $this->addRelation($v->questions);

                    $res = DB::table("q_q_p")->where("title",$v->title)->first()['id'];

                    foreach ($v->questions as $kk=>$vv){
                        $add_require=array();
                        $add_require['qpid']=$res;
                        $add_require['value']=$kk;
                        $add_require['type']=1;

                        if(is_object($vv)){
                            $add_require['relationId']=DB::table("q_q_p")->where("title",$vv->title)->first()['id'];
                            DB::table("q_relation")->insertGetId($add_require);
                        }else{
                            foreach ($vv as $kkk=>$vvv){
                                $add_require['relationId']=DB::table("q_q_p")->where("title",$vvv->title)->first()['id'];
                                DB::table("q_relation")->insertGetId($add_require);
                            }
                        }


                    }
                }

                if(property_exists($v,'childQuestion')){
                    $this->addRelation($v->childQuestion);

                    $res = DB::table("q_q_p")->where("title",$v->title)->first()['id'];

                    foreach ($v->childQuestion as $kk=>$vv){
                        $add_require=array();
                        $add_require['qpid']=$res;
                        $add_require['value']=$kk;
                        $add_require['type']=1;

                        if(is_object($vv)){
                            $add_require['relationId']=DB::table("q_q_p")->where("title",$vv->title)->first()['id'];
                            DB::table("q_relation")->insertGetId($add_require);
                        }else{

                            foreach ($vv as $kkk=>$vvv){
                                $add_require['relationId']=DB::table("q_q_p")->where("title",$vvv->title)->first()['id'];
                                DB::table("q_relation")->insertGetId($add_require);
                            }

                        }
                    }

                }

            }
        }
    }

    public function update_order(Request $request){
        //qpid 关联id order 排序id fqaspId 父类id
        $data=$request->only("qpid","fqaspId");

        if(!array_key_exists('qpid',$data)||!preg_match("/^\d*$/",$data['qpid'])) return ThrowApiExc('32024');
        if(!array_key_exists('fqaspId',$data)||!preg_match("/^\d*$/",$data['fqaspId'])) return ThrowApiExc('32016');

        $res =DB::table("q_q_p")->where("id",$data['qpid'])->update([
            "fqaspId"=>$data['fqaspId']
        ]);

        if($res){
            return [
                'status_code'      => 200,
                'message'     =>  '提交成功',
                'data' => $res
            ];
        }else{
            return [
                'status_code'      => 200,
                'message'     =>  '提交失败',
                'data' => $res
            ];
        }
    }

    function va_problemQ($id,$title,$wid){
        // if(isset($_SESSION['word_all_'.$wid])){}
        // if(strrpos($_SESSION['word_all_'.$wid],"{{2,{$id},{$title}}}")){
        
        if(strpos($_SESSION['word_all_'.$wid],"{{2,{$id},{$id}{$title}}}")||strpos($_SESSION['word_all_'.$wid],"{{2,{$id},{$title}}}")||strpos($_SESSION['word_all_'.$wid],"{{2,{$id},{$id}||||{$title}}}")){
            return true;
        }else{
            return false;
        }
    }
}
